package Day26.java.deom02;

import com.google.gson.Gson;

import java.util.HashMap;

public class Demo03 {
    public static void main(String[] args) {
        //创建Gson对象
        Gson g = new Gson();
        // 转换  {"name":"金苹果","id":"100","info":"种植苹果真辛苦"}
        HashMap data = g.fromJson("{\"name\":\"金苹果\",\"id\":\"100\",\"info\":\"种植苹果真辛苦\"}",HashMap.class);
        System.out.println(data.get("id"));
    }
}
